<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
	<div>
	<ul class="nav nav-tabs">
	  <li role="presentation" <?=$status==0?'class="active"':''?>><a href="<?=printUrl('AdminPro','storeProList', array('proId'=>$proData['proId'],'status'=>0))?>">待审核</a></li>
	  <li role="presentation" <?=$status==1?'class="active"':''?>><a href="<?=printUrl('AdminPro','storeProList', array('proId'=>$proData['proId'],'status'=>1))?>">已审核</a></li>
	</ul>
	</div>
<div class="timetips mt10"><span>所属双月：<?=$proData['timeUnitStr']?> </span><span>项目类型：<?=$proData['proTypeName']?> </span><span>截至提交时间：<?=date("Y-m-d H:i:s", $proData['endTime'])?></span></div>

<!-- 查询框开始 -->
<div class="table-responsive" style="margin-top: 20px;">
<form class="form-inline" method="GET" name="query" id="query">
<input type="hidden" name="c" id="c" value="<?php echo $this->input->get('c') ?>">
<input type="hidden" name="m" id="m" value="<?php echo $this->input->get('m') ?>">
<input type="hidden" name="proId" id="proId" value="<?php echo $proData['proId'] ?>">
<input type="hidden" name="status" id="status" value="<?php echo $this->input->get('status') ?>">
  <div class="form-group form-group-sm">
    <label for="area">地区:</label>
    <select class="form-control" id="area" name="area">
	  <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="region">大区:</label>
    <select class="form-control" id="region" name="region">
	  <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="province">省份:</label>
    <select class="form-control" id="province" name="province">
	  <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="city">城市:</label>
    <select class="form-control" id="city" name="city">
	  <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="storeId">专营店:</label>
    <select class="form-control" style="width:200px; " id="storeId" name="storeId">
	  <option value="">请选择</option>
	</select>
  </div>
  <div class="form-group form-group-sm">
    <label for="keyword">关键字：</label>
    <input type="text" class="form-control" name="keyword" id="keyword" value="<?=$keyword?>" placeholder="关键字">
  </div>
  <?php if ($status == 1): ?>
  	
  <div class="form-group form-group-sm">
    <label for="auditRs">审核结果：</label>
    <select class="form-control" id="auditRs" name="auditRs">
      <option value="">请选择</option>
	  <option value="1" <?=$auditRs==1?'selected':''?>>合格</option>
	  <option value="2" <?=$auditRs==2?'selected':''?>>不合格</option>
	  <option value="3" <?=$auditRs==3?'selected':''?>>部分合格</option>
	</select>
  </div>
  <?php endif ?>
  <div class="form-group form-group-sm">
  	<button type="submit" class="btn btn-info btn-sm">搜索</button>
  </div>
</form>
</div>
<!-- 查询框结束 -->

<!-- 表格列表 -->
<div style="margin-top: 10px;">
<table class="table table-bordered table-condensed text-center">
	<thead>
	  <tr class="active">
	    <th class="text-center">地区</th>
	    <th class="text-center">大区</th>
	    <th class="text-center">小区</th>
	    <th class="text-center">城市</th>
	    <th class="text-center">专营店名称</th>
	    <th class="text-center">专营店编码</th>
	    <?php if($status==1){ ?>
	    <th class="text-center">审核结果</th>
	    <th class="text-center">审核时间</th>
	    <?php } ?>
	    <th class="text-center">操作</th>
	  </tr>
	</thead>
	<tbody>
	  <?php foreach ($storeProList as $k => $v) {?>
	  <tr align="center">
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['area'] : ''?></td>
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['region'] : ''?></td>
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['spsarea'] : ''?></td>
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['city'] : ''?></td>
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['storeName'] : ''?></td>
	    <td><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['coding'] : ''?></td>
	    <?php if($status==1){ ?>
	    <td><?=$v['auditRsStr']?></td>
	    <td><?=date("Y-m-d H:i:s", (int)$v['auditTime'])?></td>
	    <?php } ?>
	    <td>
	    	<?php if($this->auth->checkStoreProAudit($v)){ ?>
        	<a class="btn btn-info btn-sm" role="button" href="<?php echo printUrl('AdminPro','storeProAudit', array('id'=>$v['id'])); ?>">审核</a>
        	<?php } ?>
        	<a class="btn btn-info btn-sm" role="button" href="<?php echo printUrl('AdminPro','storeProCheck', array('id'=>$v['id'])); ?>">查看</a>
	    </td>
	  </tr>
	  <?php } ?>
	</tbody>
</table>
</div>
<!-- 分页 -->
<?=$pager?>
<script type="text/javascript">
	$(function(){
		loadPlaceList('area', 'area', '', '<?=$area?>');
		loadPlaceList('region', 'region', '<?=$area?>', '<?=$region?>');
		loadPlaceList('province', 'province', '<?=$region?>', '<?=$province?>');
		loadPlaceList('city', 'city', '<?=$province?>', '<?=$city?>');
		loadPlaceList('storeId', 'store', '<?=$city?>', '<?=$storeId?>');
	});
	$('#area').change(function(){
		loadPlaceList('region', 'region', this.value, '');
		loadPlaceList('province', 'province', '', '');
		loadPlaceList('city', 'city', '', '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#region').change(function(){
		loadPlaceList('province', 'province', this.value, '');
		loadPlaceList('city', 'city', '', '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#province').change(function(){
		loadPlaceList('city', 'city', this.value, '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#city').change(function(){
		loadPlaceList('storeId', 'store', this.value, '');
	});
</script>
<?php $this->load->view('common/foot');?>